<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	renderKitId="AJAX" xmlns:epm="http://www.bp.com.cn/epm">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<script>
			//<![CDATA[
	     function operationFormatter(v, m , r, rIndex){
		 	  var dirId = r.get('id');
			  var ret = "<a href='javascript:showEs(\""+dirId+"\")'>查看</a>";
			  return ret;
		 }
		function showEs(id){
		     submitAction.addParam('dirId', id);
			 submitAction.submit();
		     //var url='#{facesContext.externalContext.requestContextPath}/modules/eop/showEmergStage.faces?id=='+id;
		    // window.open(url);
		     //showUrl('查看应急阶段',url);
		}
        function deleteConfirm(){
			if(ecyStageGridJsvar.getSelections().length == 0){
				alert("请选择一条记录！");
				return false;
			}
			return showConfirm('你确定要删除吗？');
		}
		function editConfirm(){
			if(ecyStageGridJsvar.getSelections().length == 0){
				alert("请选择一条记录！");
				return false;
			}
			return true;
		}
		function showWindow(title){
			var window_rd=window.parent.window_rd;
			window_rd.setTitle(title);
			window_rd.show();
		}
		function showUrl(url,title){
			var iframe_rd=window.parent.iframe_rd;
			iframe_rd.location.href=url;
			showWindow(title);
		}
    	   //]]>
    	</script>
	</w:head>
	<w:page title="应急阶段一览">
		<layout:panel border="false" autoHeight="true" autoWidth="true" styleClass="k4-view">
			<layout:panel id="viewtoolbar" border="false" autoHeight="true" autoWidth="true"
				styleClass="k4-view-tool">
				<w:form>
					<w:toolBar>
						<w:button label="新增阶段" image="/images/create.gif" id="addEmergencyStage" immediate="true" />
						<w:separator />
						<w:button label="编辑阶段" image="/images/edit.gif" id="eidtEmergencyStage" immediate="true"
							onclick="return editConfirm();" />
						<w:separator />
						<w:button label="删除阶段" image="/images/delete.gif" onclick="return deleteConfirm();"
							id="deleteEmergencyStage" immediate="true" />
					</w:toolBar>
				</w:form>
			</layout:panel>
			<w:dataGrid id="ecyStageGrid" height="auto" showRowNumber="true" toolBarPosition="bottom"
				autoHeight="true" paged="true" rows="10" border="false" jsvar="ecyStageGridJsvar" singleSelect="true">
				<w:outputColumn id="id" header="id" hidden="true"></w:outputColumn>
				<w:outputColumn id="stage_b" header="一级阶段" width="120" converter="commonKeyFormatter"></w:outputColumn>
				<w:outputColumn id="stage_s" header="二级阶段" width="130" converter="commonKeyFormatter"></w:outputColumn>
				<w:outputColumn id="stageDate" header="阶段日期" width="110" converter="dateMinuteFormatter"></w:outputColumn>
				<w:outputColumn id="operation" header="操作" width="80" clientFormatter="operationFormatter" />
				<w:pagingToolbar for="ecyStageGrid" displayInfo="true" displayMsg="显示 {0} - {1}，共 {2} 条" />
			</w:dataGrid>
			<ajax:submitAction id="submit" jsvar="submitAction"/>
		</layout:panel>
	</w:page>
</f:view>